<?php

namespace app\common\product\validate;

use think\Validate;

class BannerValidate extends Validate
{
    protected $rule = [
        'id' => 'require',
        'title' => 'require|max:100',
        'image' => 'require|max:200'
    ];

    protected $message = [
        'id.require' => 'ID不能为空',
        'id.integer' => 'ID必须是整数',
        'title.require' => '标题不能为空',
        'title.max' => '标题长度不能超过100个字符',
        'image.require' => '图片不能为空',
        'image.max' => '图片长度不能超过200个字符',
    ];

    protected $scene = [
        'create' => ['title', 'image'],
        'update' => ['id', 'title', 'image'],
        'delete' => ['id']
    ];
}